package io;

import java.io.*;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        //新建一个学生对象
        String name="张三";
        int age=25;
        String gender="男";
        String[] otherInfo={"是一名学生","黑龙江","打篮球"};
        Student zs=new Student(age,name,gender,otherInfo);
        System.out.println(zs);
        //创建IO流进行对象的读写
        FileOutputStream fos=new FileOutputStream("student.txt");
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        oos.writeObject(zs);
        oos.close();
        BufferedOutputStream bos=new BufferedOutputStream(fos);

    }
}
